const { createProxyMiddleware } = require('http-proxy-middleware')

module.exports = function (app) {
	app.use(
		'/jian',
		createProxyMiddleware({
			target: 'https://www.jianshu.com/asimov',
			changeOrigin: true,
			ws: false,
			pathRewrite: { '^/jian': '' },
		})
	)
	app.use(
		'/zhi',
		createProxyMiddleware({
			target: 'https://news-at.zhihu.com/api/4',
			changeOrigin: true,
			ws: false,
			pathRewrite: { '^/zhi': '' },
		})
	)
}